const axios = require('axios');

const cheerio = require('cheerio')

const url = 'http://www.xbmu.edu.cn/frontChannelPage.action?siteId=18articleClassId=104'
axios.get(url)
    .then(function (response) {
        // handle success
        console.log(response);
    })
//使用cheerio分析信息
const $ = cheerio.load(response.data);
//使用CSS选择符选择内容

console.log($('title').text()) ；
//console.log($('#container div.list-right > div-list-right-main > ul >').text());
//$('#container div.list-right > div-list-right-main > ul >').each(){
//const newDate = $(element).replaceWith().text();
//const item = $(element).text();
//const link = $(element).attr('href');
//console.log(newDate, item, link);
//};
$('#container div.list-right > div-list-right-main > ul >').each(){
    const newDate = $(element).replaceWith().text();
    const item = $(element).text();
    const link = $(element).attr('href');
    console.log(newDate, item, link);
};
    .catch (function (error) {
    // handle error
    console.log(error);
});





